package com.area.cth.validation;

import com.area.cth.anno.IsFree;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class IsFreeValidation implements ConstraintValidator<IsFree, Integer> {
    @Override
    public boolean isValid(Integer s, ConstraintValidatorContext constraintValidatorContext) {
        if (s == null) {
            return false;
        }
        if (s.equals(0) || s.equals(1)) {
            return true;
        }
        return false;
    }
}
